<!--
  @author yangjiangming
  @date 2018-12-10 20:40:28
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html th:replace="~{work/modify/common/layout :: layout('多工程师', ~{::title}, ~{::content}, ~{::script})}">
<head>
    <title>工单管理-多工程师</title>
</head>
<body>

<div th:fragment="content">
    <style>
        .layui-form-item .d-label {
            width: 50px;
        }

        .d-input {
            width: 190px;
        }

        .d-icon {
            font-size: 25px;
        }
        .d-width{
            width: 210px;
        }
    </style>
    <form action="/work/modify/save/multimaster.action" class="layui-form">
        <input type="hidden" id="casSign" name="casSign" th:value="${casSign}"/>
        <input id="work-id" type="hidden" name="workId" th:value="${workId}"/>
        <input id="order-id" type="hidden" name="orderId" th:value="${orderId}"/>

        <div class="layui-form-item">
            <label class="layui-form-label d-label">主工程师</label>
            <div class="layui-inline layui-bg-gray d-input">
                <input type="text" class="layui-input layui-bg-gray" style="border: none;" readonly th:value="${orderMaster.masterName} + '-' + ${orderMaster.masterPhone}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label d-label">多工程师</label>
            <div class="layui-inline d-master">

                <div class="layui-form-item add-master" th:each="item : ${multiMasterList}">
                    <div class="layui-inline layui-bg-gray d-input">
                        <input type="text" class="layui-input layui-bg-gray" style="border: none;" readonly="" th:value="${item.masterName} + '-' + ${item.masterPhone}">
                        <input type="hidden" name="multiMasterId" th:value="${item.masterId}"/>
                    </div>
                    <button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="delete" style="width: 54px">
                        <i class="layui-icon layui-icon-delete d-icon "></i>
                    </button>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline " style="width: 190px;">
                        <select class="d-input add-input"  lay-search lay-filter="select-master">
                            <option value="">请选择</option>
                            <option th:each="item : ${masterList}" th:value="${item.value}" th:text="${item.text}" th:disabled="${item.disabled}"></option>
                        </select>
                    </div>
                    <button class="layui-btn addmaster" lay-submit="" lay-filter="add">
                        <i class="layui-icon layui-icon-add-1 d-icon "></i>
                    </button>
                    <p>多工程师也需满足派单条件</p>
                </div>
            </div>
        </div>
        <div class="layui-form-item"  style="text-align: center">
            <div class="layui-inline">
                <input type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="save" value="保存"></input>
                <!--<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="reset">重置</button>-->
            </div>
        </div>
    </form>
    <script type="text/html" id="d-addmaster">
        <div class="layui-form-item add-master">
            <div class="layui-inline layui-bg-gray d-input">
                <input type="text" class="layui-input layui-bg-gray" style="border: none;" readonly value="{{d.name}}">
                <input type="hidden" class="multi-master-id" value="{{d.id}}"/>
            </div>
            <button class="layui-btn layui-btn-primary" lay-submit lay-filter="delete" style="width: 54px">
                <i class="layui-icon layui-icon-delete d-icon "></i>
            </button>
        </div>
    </script>
</div>

<script th:inline="javascript">
    var multiMasterList = [[${multiMasterList}]];
    // console.log(multiMasterList);
    var layuiModel = {
        oms_work_modify_multimaster: "work/modify/zmn.oms.work.modify.multimaster"
    };
</script>
</body>
</html>